
/************
* Eventos
*************/


var callbackEvents = [];

function despachaEvento( s, o ){
	
	for( var i = 0; i < callbackEvents.length; i++ ){
		if( callbackEvents[i].event == s ){
			callbackEvents[i].callback(o);
		}
	}
	

}


function escucharEvento( s, cb ){

	for(var i = 0; i < callbackEvents.length; i++ ){
		if( (s == callbackEvents[i].event) && (cb.toString() == (callbackEvents[i].callback).toString()) ){
			return;
		}
	}
	
	callbackEvents.push({ event:s, callback:cb });
}


function escucharEvento2( s, cb ){
	alert("cambiar llamada!!");
	//callbackEvents.push({ event:s, callback:cb });
}